// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
// 首页
import index from '@/views/index';
/**
 * 基础菜单
 */
// 商品管理
import Goods from '@/views/home';
//主页面
import message from '@/views/main/message';
import Main from '@/views/main';

import Mains from "@/views/main/main"
import Personal from "@/views/person/personal"
import textapple from "@/views/student/textapple"
import orderCoach from '@/views/student/orderCoach';
import onlingCar from '@/views/student/onlingCar';
import myOrder from '@/views/student/myOrder';
import myEvaluate from '@/views/student/myEvaluate';



import addSubject from '@/views/coach/addSubject';
import orderResult from '@/views/coach/orderResult';
import studentPingjia from '@/views/coach/studentPingjia';
import adminPingjia from '@/views/coach/adminPingjia';



import studentManage from '@/views/admin/studentManage';
import coachManage from '@/views/admin/coachManage';
import nowYuyue from '@/views/admin/nowYuyue';
import userShenQing from '@/views/admin/userShenQing';
import studentsPingjia from '@/views/admin/studentPingjia';
import coachPingjia from '@/views/admin/coachPingjia';
import banner from '@/views/admin/banner';
import feedback from '@/views/admin/feedback';
import noticeManage from '@/views/admin/noticeManage';
import Signup from "@/views/main/signup"

// 图表界面
import statistics from '@/views/charts/statistics';

// 启用路由
Vue.use(Router);

// 导出路由 
export default new Router({
    routes: [{
        path: '/',
        name: '',
        component: Main,
        hidden: true,
        meta: {
            requireAuth: false
        },
        children:[
            {
            path: '/',
            name: '',
            components: {
                 "main":Mains
            },
            hidden: true,
                meta: {
                    requireAuth: false
                } 
            },
            {
            path: '/user/message',
            name: '',
            components: {
                 "main":message
            },
            hidden: true,
                meta: {
                    requireAuth: false
                } 
            },
            {
                path: '/user/signup',
                name: '',
                components: {
                     "main":Signup
                },
                hidden: true,
                    meta: {
                        requireAuth: false
                    } 
            }
            ]
        },
     {
        path: '/login',
        name: '登录',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/index',
        name: '首页',
        component: index,
        iconCls: 'el-icon-tickets',
        children: [{
            path: '/',
            name: '商品管理',
            component: Goods,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/charts/statistics',
            name: '数据可视化',
            component: statistics,
            meta: {
                requireAuth: true
            }},
            {
                path: '/person/personal',
                name: '个人信息',
                component: Personal,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/student/textapple',
                name: '考试申请',
                component: textapple,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/student/orderCoach',
                name: '教练预约',
                component: orderCoach,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/student/onlingCar',
                name: '在线约车',
                component: onlingCar,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/coach/addSubject',
                name: '发布计划',
                component: addSubject,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/coach/orderResult',
                name: '预约结果',
                component: orderResult,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/student/myOrder',
                name: '我的预约',
                component: myOrder,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/student/myEvaluate',
                name: '我的评价',
                component: myEvaluate,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/coach/studentPingjia',
                name: '我的评价',
                component: studentPingjia,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/admin/studentManage',
                name: '学员管理',
                component: studentManage,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/admin/coachManage',
                name: '教练管理',
                component: coachManage,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/admin/nowYuyue',
                name: '教练管理',
                component: nowYuyue,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/admin/userShenQing',
                name: '教练管理',
                component: userShenQing,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/admin/studentsPingjia',
                name: '学员评价',
                component: studentsPingjia,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/admin/coachPingjia',
                name: '教练评价',
                component: coachPingjia,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/admin/banner',
                name: '轮播图管理',
                component: banner,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/coach/adminPingjia',
                name: '管理员评价',
                component: adminPingjia,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/admin/noticeManage',
                name: '公告',
                component: noticeManage,
                meta: {
                    requireAuth: true
                }
            },
            {
                path: '/admin/feedback',
                name: '反馈',
                component: feedback,
                meta: {
                    requireAuth: true
                }
            },

        ]
    }]
})